<?php /* SVN: $Id: index.ctp 2879 2010-08-27 11:08:48Z sakthivel_135at10 $ */ ?>
<div class="projectFunds index">
	<div class="l-curve-top">							
		<div class="r-curve-top">
			<div class="top-bg"></div>
		</div>
	</div>
	<div class="shad-bg-lft clearfix">
		<div class="shad-bg-rgt">
			<div class="shad-bg">
				<div class="main-section">
					<?php if(empty($this->request->params['named']['type'])): ?>
						<h2> <?php echo __l('Reward Voucher'); ?></h2>
						<?php if (!($projectFund['Project']['project_status_id'] == ConstProjectStatus::FundingClosed || $projectFund['Project']['project_status_id'] == ConstProjectStatus::GoalReached || $projectFund['Project']['project_status_id'] == ConstProjectStatus::ReserveAmountReached)): ?>
								<div class="content-info"><?php 
								if($projectFund['Project']['reserve_amount'] && Configure::read('Project.is_enable_threshold_limit')):
									echo __l('Reward voucher will generate after reserve amount reached.');
								else:
									echo __l('Reward voucher will generate after goal amount reached.'); 									
								endif;
									?></div>
						<?php endif; ?>
<?php if (($projectFund['Project']['project_status_id'] == ConstProjectStatus::FundingClosed || $projectFund['Project']['project_status_id'] == ConstProjectStatus::GoalReached || $projectFund['Project']['project_status_id'] == ConstProjectStatus::ReserveAmountReached)): ?>
	<span class="print-link"><?php echo $this->Html->link(__l('Print'), array('controller' => 'project_funds', 'action' => 'view', $projectFund['ProjectFund']['id'],'type'=>'print'), array('escape' => false,'target'=>'_blank','title'=>__l('Print'), 'class' => 'print-voucher')); ?></span>
<?php endif; ?>
					<?php endif; ?>
					<?php
						if (!empty($projectFund)):
					?>
<div style="padding: 10px; width: 800px; margin: auto;font-size:12px;">
<div style="width:750px; margin:0px auto;margin:0px;padding:0px; font-family:Arial, Helvetica, sans-serif; font-size:12px;color:#000;">
<div style="color:#999;  border:2px solid #000; padding:20px; background:#fff;">
  <table width="100%" style="background-color:#fff;border-bottom:2px solid #ddd;padding:0px;margin:0px;">
<tr>
      <td width="70%" style="padding:10px 0px;">
		<?php echo $this->Html->image(Router::url(array(
					'controller' => 'img',
					'action' =>'logo.png',
					'admin' => false
				),true), array('alt'=> __l('[Image: Logo]'), 'title' => Configure::read('site.name'))); ?>
       </td>
      <td width="30%" style="padding:10px 0px;">
      	  <strong style="width:120px;margin:0px;padding:0px 0px 0px 10px;font-size:20px;color:#000;">
			<?php if (($projectFund['Project']['project_status_id'] == ConstProjectStatus::FundingClosed || $projectFund['Project']['project_status_id'] == ConstProjectStatus::GoalReached || $projectFund['Project']['project_status_id'] == ConstProjectStatus::ReserveAmountReached)): ?>
				<?php echo '#'.$projectFund['ProjectFund']['coupon_code'];?>
			<?php else: ?>
				<?php echo '#XXXXXXXXXX';?>
			<?php endif; ?>
			</strong>
      </td>
    </tr>
    <tr>	
</table>
		<p>
			<strong style="color:#000; font-size:20px;display:block;margin:15px 0px 10px 0px; "><?php echo $this->Html->cText($projectFund['Project']['name']);?></strong>
		</p>
      <div  style=" margin:0px,padding:10px;">
		<table style="" style="background-color:#fff;border-bottom:2px solid #ddd;padding:0px;margin:0px;width: 100%; font-size:12px;color:#000;">
		<tbody>
		<tr>
			<td style="width: 49%;line-height:22px;vertical-align:top;color:#000;">
				<strong style="color:#000; font-size4:16px;display:block;margin:5px 0px 0px 0px;"><?php echo __l('Recipient:');?></strong>
				<p style="font-family:arial;font-size:13px;margin:0px;padding:0px;">	<?php echo $this->Html->cText($projectFund['User']['username']);?></p>
				<strong style="color:#000; font-size4:16px;display:block;margin:5px 0px 0px 0px;"><?php echo __l('Reward:');?></strong>
				<p style="font-family:arial;font-size:13px;margin:0px;padding:0px;">	<?php echo $this->Html->cText($projectFund['ProjectReward']['reward']);?></p>
			</td>
<td style="width: 49%;line-height:22px; color:#000;" valign="top">
				<dl style="margin:0px;padding:0px;">
				
					<dt style="width:120px; float:left; margin:0px; padding:0px; text-align:right; font-weight:bold; color:#000;"><?php echo __l('Redeem At: ')?></dt>
				  <dd style="width:157px;float:left;margin:0px;padding:0px 0px 0px 10px; font-family:arial;font-size:13px;">
					<?php echo $this->Html->cText($projectFund['Project']['User']['username']);?><br />
				  </dd>
					<dt style="width:120px; float:left; margin:0px; padding:0px; text-align:right; font-weight:bold; color:#000;"><?php echo __l('Pledged on:  ')?> </dt>
				  <dd style="width:157px;float:left;margin:0px;padding:0px 0px 0px 10px;font-family:arial;font-size:13px;"><?php echo $this->Html->cDate($projectFund['ProjectFund']['created']);?></dd>
				</dl>
				<div style="clear:both"></div>
				<div style="margin:0px 0px 0px 20px;padding:0px 0px 0px 10px;font-family:arial;font-size:13px;">
					<?php
				if(Configure::read('barcode.is_barcode_enabled') == 1){
					  $barcode_width = Configure::read('barcode.width');
					  $barcode_height = Configure::read('barcode.height');
						  $parsed_url = parse_url($this->Html->url('/', true));
						  $qr_mobile_site_url = str_ireplace($parsed_url['host'],  $parsed_url['host'], Router::url(array(
								'controller' => 'project_funds',
								'action' => 'check_qr',
								$projectFund['ProjectFund']['id'],
								$projectFund['ProjectFund']['unique_coupon_code'],
								'admin' => false
							) , true));

						  ?>
					       <img src="http://chart.apis.google.com/chart?cht=qr&chs=<?php echo $barcode_width; ?>x<?php echo $barcode_height; ?>&chl=<?php echo $qr_mobile_site_url; ?>" alt = "[Image: Project qr code]"/>
						<p style="margin:0px 0px 0px 28px;padding:0px;font-weight:bold;"><?php
					  echo $projectFund['ProjectFund']['unique_coupon_code'];?></p><?php
				}
				 ?>
                </div>
			</td>
		</tr>
		</tbody>
		</table>
        </div>
</div>
    <table style="margin:10px 0px 0px 0px;padding:10px;">
        <tr>
        <td width="60%" style="vertical-align:top;">
          	<strong style="color:#000;padding:10px 0px 0px 0px;font-size: 16px; "><?php echo __l('How to use this:');?></strong><br/>
				<ol style="list-style-type:decimal;list-style-position:inside;margin:10px 0px; font-family:arial;font-size:14px;">
					<li style="margin:3px 0px;padding:0px;"><?php echo __l('Print voucher') ?></li>
					<li style="margin:3px 0px;padding:0px;"><?php echo __l('Present voucher upon arrival.');?></li>
					<li style="margin:3px 0px;padding:0px;"><?php echo __l('Enjoy!');?></li>
				</ol>
				</td>
				<td width="40%" style="vertical-align:top;">
					<strong style="color:#000; font-size:16px;padding:10px 0px 0px 0px;"><?php echo __l('Map:');?></strong>
						<div  style="margin:5px 0px 0px 0px;">
						<?php $map_zoom_level = '7';?>
						<?php 
							echo $this->Html->image($this->Html->formGooglemap($projectFund['Project'],'320x250'));
						?>
					</div>
				</td>
			</tr>
		
		</table>

	</div>
</div>
<?php if(!empty($this->request->params['named']['type']) && $this->request->params['named']['type'] == 'print'): ?>
	<script>
         window.print();
    </script>
<?php endif; ?>

					<?php
						endif;
					?>
				</div>
			</div>
		</div>
	</div>
</div>
<div class="l-curve-bot">							
	<div class="r-curve-bot">
		<div class="bot-bg"></div>
	</div>
</div>
